#include "truncate.h"
#include "append.h"

Truncate::Truncate(TableMapping &tableMapping, Oracle::Connection &connection):Load(tableMapping, connection)
{
}

int Truncate::load()
{
	if (Load::load() != 0){
		error<<"truncate data error"<<endl;
		return -1;
	}
	
	Append append(tableMapping, connection);
	return append.load();
}

int Truncate::createSql()
{
	const Table &tagetTable = tableMapping.getTargetTable();
	
	sql  = "truncate table ";
	sql += tagetTable.getName();
}
